import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'/index',
    children:[
      // {path:'/index',component: ()=>import('../views/home/IndexView')},
      {path:'/reg',component: ()=>import('../views/home/RegView')},
      {path:'/login',component: ()=>import('../views/home/LoginView')},
      // {path:'/detail',component: ()=>import('../views/home/DetailView')},
      // {path:'/list',component: ()=>import('../views/home/ListView')},
      {path:'/personal',
        redirect:'/personal/info',
        component: ()=>import('../views/home/PersonalView'),
        children:[
          {path:'index',component: ()=>import('../views/home/personal/IndexView.vue')},
          {path:'order',component: ()=>import('../views/home/personal/OrderView.vue')},
          {path:'exchangeOrder',component: ()=>import('../views/home/personal/ExchangeOrderView.vue')},
          {path:'collection',component: ()=>import('../views/home/personal/CollectionView.vue')},
          {path:'info',component: ()=>import('../views/home/personal/InfoView.vue')},
          {path:'safe',component: ()=>import('../views/home/personal/SafeView.vue')},
          {path:'changePassword',component: ()=>import('../views/home/personal/ChangePasswordView.vue')},
          {path:'authentication_1',component: ()=>import('../views/home/personal/AuthenticationView_1.vue')},
          {path:'authentication_2',component: ()=>import('../views/home/personal/AuthenticationView_2.vue')},
          {path:'bindEmail',component: ()=>import('../views/home/personal/BindEmailView.vue')},

          // {path:'management',component: ()=>import('../views/home/personal/ManagementView')},
          // {path:'post',component: ()=>import('../views/home/personal/PostView')}
        ]
      },
      {
        path:'/outbound/travel',
        component: ()=>import('../views/home/OutboundTravel.vue')
      },
      {
        path:'/outback/travel',
        component: ()=>import('../views/home/OutbackTravel.vue')
      }
    ]
  },
    {
      path: '/booking',
      redirect: '/booking/check',
      component: () => import( '../views/BookingView.vue'),
      children: [
          {path: 'check', component: () => import( '../views/booking/CheckView.vue')},
          {path: 'paymode', component: () => import( '../views/booking/PaymodeView.vue')},
          {path: 'submit', component: () => import('../views/booking/SubmitView.vue')}
      ]
    }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
